import { uniFetch } from './uni-fetch.js'

/**
 * 消息列表
 * @property {string} contentType - 消息类型 200 201
 * @property {string} page - 消息数据对应的页码
 * @property {string} pageSize - 每页包含消息数据的条数
 */
export const getListApi = (contentType, page = 1, pageSize = 5) => {
  if (!contentType) return
  return uniFetch.get('/driver/messages/page', { contentType, page, pageSize })
}

/**
 * 全部消息已读
 */
export const allReadApi = (contentType) => {
  if (!contentType) return
  return uniFetch.put(`/driver/messages/readAll/${contentType}`)
}
